program sunspot
	real :: obs(44,2)
	real :: pred(44,2)
	integer :: i
	real, parameter :: pi = 3.14159265359

	open(1, file="obspots.dat")
	open(2, file="pspots.dat")
	open(3, file="diff.dat")
	do i = 1,44
		read(1,*),obs(i,1), obs(i,2)
		write(2,*),obs(i,1), sunspots(obs(i,1))
		write(3,*),obs(i,1), obs(i,2)-sunspots(obs(i,1))
	end do
	close(1)
	close(2)
	close(3)
	
contains
	real function sunspots(t)
		real,intent(in) :: t
		sunspots = 60+(50*cos((2*pi/11)*(t-1948)))
	end function
end program
